//============================================================================
// Copyright (C) 2003-2013 Brett R. Jones 
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses 
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================
#include "RcSktLib.h"

/*
//=================================================================
// Key generation methods
//=================================================================
//---------------------------------------------------------------------------
//! generate key from announce and connection data and place in sockets m_oRxKey and initialize its crypto
RCODE GenerateRxConnectionKey(	VxSktBase *			poSkt,		// pointer to VxSktBase
								VxNetIdentBase *	poIdent )	// announce packet
{
	RCODE rc = GenerateConnectionKey(	&poSkt->m_oRxKey,		// set this key
										poIdent );				// announcement packet	
	if( 0 == rc )
	{
		poSkt->m_oRxCrypto.ImportKey( &poSkt->m_oRxKey );
	}
	else
	{
		vx_assert( false );
	}
	return rc;
}

//---------------------------------------------------------------------------
//! generate key from announce and connection data and place in sockets m_oTxKey and initialize its crypto
RCODE GenerateTxConnectionKey(	VxSktBase * poSkt,				// pointer to VxSktBase
								VxNetIdentBase * poIdent )	// announce packet
{
	RCODE rc = GenerateConnectionKey(	&poSkt->m_oTxKey,	// set this key
										poIdent );			// announcement packet	
	if( 0 == rc )
	{
		poSkt->m_oTxCrypto.ImportKey( &poSkt->m_oTxKey );
	}
	else
	{
		vx_assert( false );
	}
	return rc;
}


//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//! generate key from announce and connection data and place in sockets m_oRxKey and initialize its crypto
RCODE GenerateRxConnectionKey(	VxSktConnectSimple *	poSkt,		// pointer to VxSktConnectSimple
								VxNetIdentBase *		poIdent )	// announce packet
{
	RCODE rc = GenerateConnectionKey(	&poSkt->m_oRxKey,		// set this key
										poIdent );				// anouncement packet	
	if( 0 == rc )
	{
		poSkt->m_oRxCrypto.ImportKey( &poSkt->m_oRxKey );
	}
	else
	{
		vx_assert( false );
	}
	return rc;
}

//---------------------------------------------------------------------------
//! generate key from announce and connection data and place in sockets m_oTxKey and initialize its crypto
RCODE GenerateTxConnectionKey(	VxSktConnectSimple *	poSkt,		// pointer to VxSktConnectSimple
								VxNetIdentBase *		poIdent )	// announce packet
{
	RCODE rc = GenerateConnectionKey(	&poSkt->m_oTxKey,	// set this key
										poIdent );			// anouncement packet	
	if( 0 == rc )
	{
		poSkt->m_oTxCrypto.ImportKey( &poSkt->m_oTxKey );
	}
	else
	{
		vx_assert( false );
	}
	return rc;
}
*/
